package com.hpeu_01.day0120;

import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.InputStream;

public class IODemoe01 {
    public static void main(String[] args) {
        InputStream is =null;
        try {
            is =new FileInputStream("D:\\project\\JAVA\\java\\JavaSE\\src\\com\\hpeu_01\\day0120\\file\\a.txt");
            int available = is.available();
            System.out.println(available);
            //读取
            int read = is.read();
            System.out.println((char) read);
            read = is.read();
            System.out.println((char)read);
            read = is.read();
            System.out.println((char)read);
            read = is.read();
            System.out.println((char)read);
            read = is.read();
            System.out.println((char)read);
        } catch (IOException e) {
            e.printStackTrace();
        }finally {
            if (is != null){
                try {
                    is.close();
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
        }
    }
}
